package cn.edu.seu.cose.qol.ws.resource;

import org.restlet.representation.Representation;
import org.restlet.resource.ServerResource;

import cn.edu.seu.cose.qol.ws.resource.util.OperationResultRepresentationBuilder;


public abstract class QolServerResource extends ServerResource {
	
	protected static Representation getRepresentationByException(
			Exception e) {
		OperationResultRepresentationBuilder builder =
				OperationResultRepresentationBuilder.getInstance();
		return builder.getOperationResult(e);
	}
	
	protected static Representation getSuccessRepresentation() {
		OperationResultRepresentationBuilder builder =
				OperationResultRepresentationBuilder.getInstance();
		return builder.getOperationResult(true);
	}

}
